import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/http/bean/wroks/customers_copyInfo.dart';
import 'package:app/src/ui/app_ui.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';
import 'package:app/src/utils/image_path_utils.dart';

import '../../../../../http/bean/works_2023/commission_bean.dart';

///提成审核,金额信息
class UiPercentageCheckAcount {
  ///data 客户信息
  ///oldData 历史客户信息
  static Widget build(BuildContext context, PercentageCheckBean? data,
      PercentageCheckBean? oldData) {
    if (StringUtils.isEmpty(data)) {
      return AppUi.getEmptyView();
    }
    List<Widget> children = [];
    children
        .add(UiBase.title(context, AppStrings.of(context).AmountInformation)); //标题：金额信息
    children.add(UiBase.item(
        context,
        AppStrings.of(context).merchandiserSalesname_,
        data?.merchandiserSalesname,
        oldData?.merchandiserSalesname)); //姓名
    children.add(UiBase.item(context, AppStrings.of(context).amount1_,
        data?.amount1, oldData?.amount1)); //收款金额
    children.add(UiBase.item(context, AppStrings.of(context).amount2_,
        data?.amount2, oldData?.amount2)); //提成金额
    children.add(UiBase.item(context, AppStrings.of(context).amount3_2("30%"),
        data?.amount3, oldData?.amount3)); //结存金额（30%累计），这个百分比，erp前端也是写死的。
    children.add(UiBase.item(context, AppStrings.of(context).amount4_,
        data?.amount4, oldData?.amount4)); //上报金额

    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
